package edu.calvin.djs32.cs214.interpreters.calculator.primitives;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import edu.calvin.cs214.hobbes2008.IntegerTIR;
import edu.calvin.cs214.hobbes2008.StringTIR;
import edu.calvin.cs214.hobbes2008.TupleTIR;


public class GreaterThanOrEqualsToPrimitiveTest {
	@Test
	public void shouldApplyIntegers(){
		assertEquals(new TupleTIR(), new GreaterThanOrEqualsToPrimitive().apply(null, new IntegerTIR(-2), new IntegerTIR(33)));
		assertEquals(new StringTIR("true"), new GreaterThanOrEqualsToPrimitive().apply(null, new IntegerTIR(-2), new IntegerTIR(-2)));
		assertEquals(new StringTIR("true"), new GreaterThanOrEqualsToPrimitive().apply(null, new IntegerTIR(4), new IntegerTIR(-2)));
	}
	
	@Test
	public void shouldApplyStrings(){
		assertEquals(new TupleTIR(), new GreaterThanOrEqualsToPrimitive().apply(null, new StringTIR("foo"), new StringTIR("fooo")));
		assertEquals(new StringTIR("true"), new GreaterThanOrEqualsToPrimitive().apply(null, new StringTIR("foo"), new StringTIR("fo")));
		assertEquals(new StringTIR("true"), new GreaterThanOrEqualsToPrimitive().apply(null, new StringTIR("foo"), new StringTIR("foo")));
	}

}
